<?php
// 添加模块需要查询父分区

$sql = "SELECT zid,title FROM `zone_modul_tb` WHERE parentid=0 ;";
$data_list = array();
if (!my_mysql_query($sql, $data_list)){
	echo '初始化数据失败!';
	exit();
}

if (empty($data_list)){
	echo '没有分区.请先添加分区';
	exit();
}

?>

<style type="text/css">
#add_zone_table {
	border: 0;
	width: 500px;
	margin-top: 50px;
	margin-left: 50px;
}
#add_zone_table input,#add_zone_table select {
	width: 300px;
	height: 24px;
	margin-left: 50px;
}
button {
	width: 183px;
	height: 32px;
	border: 0;
	color: white;
	font-size: 18px;
	background: url(image/button.png) 0 0 no-repeat;
}
</style>

<form action="zone_modul_handler.php" method="POST" enctype="multipart/form-data">
	<input type="hidden" name="action" value="3">
	<table id="add_zone_table">
		<caption><h1>添加模块</h1></caption>
	<tr>
		<td align="center">模块名称</td>
		<td>
			<input type="text" name="title">
		</td>
	</tr>
	<tr>
		<td align="center">模块描述</td>
		<td>
			<input type="text" name="intro">
		</td>
	</tr>
	<tr>
		<td align="center">所属分区</td>
		<td>
			<select name="parentid">
			<?php
			foreach($data_list as $zone) {
				echo '<option value="'.$zone['zid'].'">'.$zone['title'].'</option> ';
			}
			?>

			</select>
			
		</td>
	</tr>
	<tr>
		<td align="center">分区封面</td>
		<td>
			<input type="file" name="image">
		</td>
	</tr>
	<tr>
		<td colspan=2 align="center">
			<button type="submit">提交</button>
		</td>
	</tr>
	
</form>